<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>

    <link rel="stylesheet" href="css/backstage.css">
    <link rel="stylesheet" href="layui/src/css/layui.css">
    <script type="text/javascript" src="js/JQ.js"></script>
    <script src="layui/src/layui.js"></script>

</head>
<body>
<button class="layui-btn" onclick="studentFind();">查找</button>
<!--姓名、性别、年龄、电话号码、购买类型、剩余次数、登记时间、次数消耗时间-->
<table class="layui-table">
    <thead>
    <tr>
        <th>标题</th>
        <th>作者</th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td><input id="title" class="layui-input" type="text"></td>
        <td><input id="author" class="layui-input" type="text"></td>
    </tr>
    </tbody>
</table>
<p class="layui-colla-title">查找结果</p>
<table class="layui-table" lay-filter="parse-table-demo2">
    <thead>
    <tr>
        <!--<th lay-data="{field:'layTableCheckbox',type:'checkbox', fixed: 'left'}"></th>-->
        <th lay-data="{field:'id_data', width:100, title: 'ID'}"></th>
        <th lay-data="{field:'title', width:100, title: '标题'}"></th>
        <th lay-data="{field:'content', width:200, title: '内容'}"></th>
        <th lay-data="{field:'appendix', width:120, title: '附件'}"></th>
        <th lay-data="{field:'author', width:100, title: '作者'}"></th>
        <th lay-data="{field:'time', width:200, title: '上传时间'}"></th>
    </tr>
    </thead>
    <tbody id="data1">
    </tbody>
</table>
</body>
<script>
    //查找学生
    var studentFind = function(){
        var title = document.getElementById("title").value;
        var author = document.getElementById("author").value;

        $.post(
            "/data/find_data_data_html",
            {
                "title":title,
                "author":author
            },
            function(data,states){
                document.getElementById("data1").innerHTML=data;

                layui.use('table', function(){
                    var table = layui.table;
                    table.init('parse-table-demo2', { //转化静态表格
                        //height: 'full-500'
                    });
                });
            }
        );
    }

</script>
</html>